
// 中草药品接口相关的函数
import request from "@/untils/request.js"

/**
 * 
 * @param { post } data 
 *  
 */

// 新增中药
export const addTraMedici = (data) => {
    return request.post("/outpatient/traMedici/save", data)
}
// 修改中药
export const UpdateTraMedici = (data) => {
    return request.post("/outpatient/traMedici/updatedTra", data)
}
// 修改中药库退库
export const editOutbound = (data) => {
    return request.post("/outpatient/purcRetn/edit", data)
}


// 新增中药采购计划
export const addTcm = (data) => {
    return request.post("/outpatient/Tcm/save", data)
}
// 新增中药采购入库
export const addPurctcmdoc = (data) => {
    return request.post("/outpatient/purctcmdoc", data)
}
// 新增中药采购退库
export const addOutbound = (data) => {
    return request.post("/outpatient/purcRetn/addOutbound", data)
}
// 新增中药品调拨
export const addpurctcmallocate = (data) => {
    return request.post("/outpatient/dpurctcmallocate", data)
}
// 中药调拨单 = > 快速调拨
export const fastTransfer = (data) => {
    return request.post("/outpatient/dpurctcmallocate/fastTransfer", data)
}
// 修改中药品调拨
export const editpurctcmallocate = (data) => {
    return request.put("/outpatient/dpurctcmallocate", data)
}
// 新增中药库存盘点
export const tcmskinsert = (data) => {
    return request.post("/outpatient/tcmSk/insert", data)
}
// 修改中药采购计划
export const editTcm = (data) => {
    return request.post("/outpatient/Tcm/edit", data)
}
// 修改中药采购入库
export const editPurctcmdoc = (data) => {
    return request.put("/outpatient/purctcmdoc", data)
}
// 修改中药采购退库
export const editTcmRetn = (data) => {
    return request.put("/outpatient/tcmRetn", data)
}

// 中药采购计划 => 审核，过单
export const toExamineTcm = (data) => {
    return request.post("/outpatient/Tcm/toExamine", data)
}
// 中药采购入库 => 审核，过单
export const toExaminePurctcmdoc = (params) => {
    return request.get("/outpatient/purctcmdoc/change", {params})
}
// 中药采购退库 => 审核，过单
export const toRetnExamine = (data) => {
    return request.post("/outpatient/purcRetn/toRetnExamine", data)
}
// 中药药品调拨 => 审核，过单
export const dpurctcmallocateExamine = (params) => {
    return request.get("/outpatient/dpurctcmallocate/change", { params })
}

// 中药采购退库 => 药品流向记录
export const purcRetnPages = (params) => {
    return request.get("/outpatient/purcRetn/pages", {params})
}


// 点击批次号显示
export const getBatchNumber = (params) => {
    return request.get("/outpatient/purctcmtable/getBatchNumber", { params } )
}
// 点击效期调整
export const getExpyDate = (params) => {
    return request.get("/outpatient/purctcmtable/getExpyDate", { params } )
}
// 更新有效日期
export const updateDate = (params) => {
    return request.get("/outpatient/purctcmtable/updateDate", { params } )
}

/**
 * 
 * @param { get } params 
 *  
 */

// 中药列表
export const traMediciList = (params) => {
    return request.get("/outpatient/traMedici/page", { params })
}
// 中药库存列表
export const PurctcmtableList = (params) => {
    return request.get("/outpatient/purctcmtable/list", { params })
}
// 退货列表
export const purcRetnList = (params) => {
    return request.get("/outpatient/purcRetn/page", { params })
}

// 包装单位
export const getDrugUnt = (params) => {
    return request.get("/outpatient/getDrugUnt", { params })
}
// 剂量单位
export const getDosaUnt = (params) => {
    return request.get("/outpatient/getDosaUnt", { params })
}
// 新增药品基础信息-查询加成率
export const docMarkById = (params) => {
    return request.get("/outpatient/docMark/getById", { params })
}
// 修改返回数据填充，双击详情页
export const getTraMedic = (params) => {
    return request.get("/outpatient/traMedici/getTraMedic", { params })
}

// 中药采购计划-分页
export const TcmPage = (params) => {
    return request.get("/outpatient/Tcm/page", { params })
}
// 中药采购入库-分页
export const purctcmdocPage = (params) => {
    return request.get("/outpatient/purctcmdoc/page", { params })
}
// 中药其他入库-分页
export const purctcmtablePage = (params) => {
    return request.get("/outpatient/purctcmtable/getOther", { params })
}
// 中药品调拨单-分页
export const dpurctcmallocate = (params) => {
    return request.get("/outpatient/dpurctcmallocate/page", { params })
}

// 中药库采购入库单_主表-信息
export const getPurctcmdocPage = (params) => {
    return request.get("/outpatient/purctcmdoc/get", { params })
}

// 中药品调拨单-信息
export const getDpurctcmallocate = (params) => {
    return request.get("/outpatient/dpurctcmallocate/get", { params })
}
// 中药品调拨单_修改状态状态
export const changeDpurctcmallocate = (params) => {
    return request.get("/outpatient/dpurctcmallocate/change", { params })
}

// 中药库盘点-草稿录入
export const PdtcmSk = (data) => {
    return request.post("/outpatient/tcmSk", data)
}
// 中药品调拨单_作废
export const Canceldpurctcmallocate = (params) => {
    return request.get("/outpatient/dpurctcmallocate/cancel", { params })
}

// 申请人员工列表
export const selectInformation = (params) => {
    return request.get("/outpatient/selectInformation", { params } )
}	
// 供应商下拉列表
export const selectDropDownList = (params) => {
    return request.get("/outpatient/selectDropDownList", { params })
}
// 中药采购计划详情
export const TcmDetail = (params) => {
    return request.get("/outpatient/Tcm/detail", { params })
}

// 添加中药采购入库的时候选择采购计划展示列表
export const getTcmPlans = (params) => {
    return request.get("/outpatient/Tcm/getTcmPlans", { params })
}
// 添加中药采购入库的时候采购计划选择要采购的计划数据
export const getTcmPlanData = (params) => {
    return request.get("/outpatient/Tcm/getTcmPlanData", { params })
}
// 新建退药，选择药品
export const purcRetnSelectDrug = (params) => {
    return request.get("/outpatient/purcRetn/selectDrug", { params })
}
// 通过药品Id查询出中药下面的生产厂家
export const getProdent = (params) => {
    return request.get("/outpatient/traMedici/getTcmCj", { params })
}
/*
	Others
*/
// 中药库盘点点击查看或者草稿操作
export const getSkVo = (params) => {
    return request.get("/outpatient/tcmSk/getTcmSkVo", { params })
}
// 中药库盘点-提交-审核
export const tcmSkCheck = (params) => {
    return request.get("/outpatient/tcmSk/check", { params })
}
// 中药房盘点-提交-审核
// export const pharskCheck = (params) => {
//     return request.get("/outpatient/zyfpd/check", { params })
// }
// 获取厂家信息
export const getManufacturer = (params) => {
    return request.get("/outpatient/getManufacturer", { params })
}
// 获取药品加成率 => 中药
export const getDocMark = (params) => {
    return request.get("/outpatient/docMark/page", { params })
}
// 中药库存列表
export const pageList = (params) => {
    return request.get("/outpatient/purctcmtable/pageList", {params})
}
// 中药库盘点列表-分页
export const tcmskpage = (params) => {
    return request.get("/outpatient/tcmSk/page", { params })
}
// 中药调拨单 = > 加入
export const dpurctcmallocateJoin = (params) => {
    return request.get("/outpatient/dpurctcmallocate/join", {params})
}
// 中药退库详情页
export const getRetnList = (params) => {
    return request.get("/outpatient/purcRetn/getRetnList", {params})
}
// 中药退库详情页 - 加入
export const purcRetnjoin = (params) => {
    return request.get("/outpatient/purcRetn/join", {params})
}
// 查询所有科室列表
export const findAttribute = (params) => {
    return request.get("/outpatient/findAttribute", {params})
}

/**
 * 
 * @param { DELETE } params 
 *  
 */   
// 中药目录列表删除
export const deleteTP = (params) => {
    return request.delete("/outpatient/traMedici/deleteTP", { params })
}
// 采购计划草稿作废删除
export const deleteTcmPlanData = (params) => {
    return request.delete("/outpatient/Tcm/deleteTcmPlanData", { params })
}
// 采购入库草稿作废删除
export const deleteTcm = (params) => {
    return request.delete("/outpatient/purctcmdoc/deleteTcm", { params })
}
// 采购退库删除
export const deleteRetn = (params) => {
    return request.delete("/outpatient/purcRetn/deleteBy", { params })
}

// 暴露
export default{
	traMediciList,getTraMedic,getProdent,
	getDrugUnt,getDosaUnt,docMarkById,
	addTraMedici,UpdateTraMedici,deleteTP,
	// 入库
	getTcmPlans,getTcmPlanData,deleteTcm,
	// 库存列表
	PurctcmtableList,
	// 盘点
	tcmskinsert,getSkVo,PdtcmSk,tcmskpage,tcmSkCheck,
	// 退库
	deleteRetn,editTcmRetn,
	TcmPage,addTcm,editTcm,toExamineTcm,
	selectInformation,selectDropDownList,TcmDetail,
	// 效期
	getBatchNumber,getExpyDate,updateDate,
	purctcmdocPage,addPurctcmdoc,editPurctcmdoc,getPurctcmdocPage,toExaminePurctcmdoc,deleteTcmPlanData,purctcmtablePage,
	getManufacturer,getDocMark,
	pageList,purcRetnList,purcRetnSelectDrug,dpurctcmallocateJoin,
	addOutbound,toRetnExamine,getRetnList,purcRetnPages,purcRetnjoin,editOutbound,
	// 调拨
	dpurctcmallocate,addpurctcmallocate,dpurctcmallocateExamine,Canceldpurctcmallocate,changeDpurctcmallocate,getDpurctcmallocate,editpurctcmallocate,fastTransfer,
	// 科室档案
	findAttribute
	
}